package cn.wuxuan.po;

import java.util.List;

public class PageResult {
private List<?> dataList;
private Integer pageSize;
private Integer currentPage;
private Integer totalCount;

private Integer totalPage;
private Integer prePage;
private Integer nextPage;

public PageResult() {
	super();
}


public PageResult(List<?> dataList, Integer pageSize, Integer currentPage,
		Integer totalCount) {
	super();
	this.dataList = dataList;
	this.pageSize = pageSize;
	this.currentPage = currentPage;
	this.totalCount = totalCount;
	
	this.totalPage=(totalCount%pageSize==0)?totalCount/pageSize:(totalCount/pageSize)+1;
	this.prePage = (currentPage==1)?1:currentPage -1;
	this.nextPage =(currentPage==totalPage)?currentPage +1:totalPage;
}


public List<?> getDataList() {
	return dataList;
}

public void setDataList(List<?> dataList) {
	this.dataList = dataList;
}

public Integer getPageSize() {
	return pageSize;
}

public void setPageSize(Integer pageSize) {
	this.pageSize = pageSize;
}

public Integer getCurrentPage() {
	return currentPage;
}

public void setCurrentPage(Integer currentPage) {
	this.currentPage = currentPage;
}

public Integer getTotalCount() {
	return totalCount;
}

public void setTotalCount(Integer totalCount) {
	this.totalCount = totalCount;
}

public Integer getTotalPage() {
	return totalPage;
}

public Integer getPrePage() {
	return prePage;
}

public Integer getNextPage() {
	return nextPage;
}

@Override
public String toString() {
	return "PageResult [dataList=" + dataList + ", pageSize=" + pageSize
			+ ", currentPage=" + currentPage + ", totalCount=" + totalCount
			+ ", totalPage=" + totalPage + ", prePage=" + prePage
			+ ", nextPage=" + nextPage + "]";
}

}
